package member

import (
	"github.com/go-playground/validator/v10"
	//"gopkg.in/go-playground/validator.v8"
	//"reflect"
)

// NameValid 是自定义的验证函数
func NameValid(fl validator.FieldLevel) bool {
	if s, ok := fl.Field().Interface().(string); ok {
		if s == "admin" {
			return false
		}
	}
	return true
}

/*func NameValid(
	v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value,
	field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string,
) bool {
	if s, ok := field.Interface().(string); ok {
		if s == "admin" {
			return false
		}
	}
	return true
}*/
